package com.cyt.work.wb.model.po;

import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 维保模块_人员信息-人员信息实体类
 *
 * @author shengQiang Yu
 * @date 2019-11-28 15:14:32
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_wb_user")
public class WbUser implements Serializable {

	/**
     * 主键ID
     */ 
	@Id
	private String id;

	/**
     * 应用id
     */ 
	@Column(name = "apply_id")
	private String applyId;

	/**
     * 会员id
     */ 
	@Column(name = "member_id")
	private String memberId;

	/**
     * 人员姓名
     */ 
	@Column(name = "name")
	private String name;

	/**
     * 人员编号
     */ 
	@Column(name = "num")
	private String num;

	/**
     * 人员类型
     */ 
	@Column(name = "type")
	private String type;

	/**
     * 人员角色
     */ 
	@Column(name = "role")
	private String role;

	/**
     * 手机号
     */ 
	@Column(name = "phone")
	private String phone;

	/**
     * 登录密码
     */ 
	@Column(name = "password")
	private String password;

	/**
     * 有效状态
     */ 
	@Column(name = "status")
	private String status;

	/**
     * 服务商ID
     */ 
	@Column(name = "servicer_id")
	private String servicerId;

	/**
	 * 服务商名称
	 */
	@Transient
	private String servicerIdName;

	/**
     * 删除标识
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
	 * 创建对象
	 *
	 * @param sysUser 当前用户信息
	 * @author shengQiang Yu
	 * @date 2019-11-28 15:14:32
	 */
	public WbUser(SysUser sysUser) {
		this.id = BaseUtil.uId();
		this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}

	public WbUser(String memberId) {
		this.memberId = memberId;
	}
}